import { Button, Label, Node, utils } from "cc";
import { IView } from "../../frame/common/view/IView";
import { ViewBase } from "../../frame/common/view/ViewBase";
import { Util } from "../../Util";
import { DemoPageCtrl } from "./DemoPageCtrl";


export class DemoPageView extends ViewBase implements IView {

    title: Node = null;

    get myViewCtrl(): DemoPageCtrl {
        return this._viewCtrl as DemoPageCtrl;
    }

    bindNode(): void {
        super.bindNode();
        this.title = Util.ins.render.searchChild(this.node, "title");
    }

    unBindNode(): void {
        super.unBindNode();
        this.title = null;
    }

    showTitle(str: string): void {
        this.title.getComponent(Label).string = str;
    }

}